#!/bin/bash

echo "启动RealSense相机节点..."
gnome-terminal -- ros2 launch realsense2_camera rs_launch.py \
    pointcloud.enable:=true \
    align_depth.enable:=true \
    enable_color:=true \
    enable_depth:=true

sleep 5

echo "启动RTAB-Map建图节点..."
ros2 launch rtabmap_launch rtabmap.launch.py \
    rtabmap_args:="--delete_db_on_start" \
    frame_id:=camera_link \
    rgb_topic:=/camera/camera/color/image_raw \
    depth_topic:=/camera/camera/depth/image_rect_raw \
    camera_info_topic:=/camera/camera/color/camera_info \
    approx_sync:=true \
    rtabmap_viz:=true \
    rviz:=true
